package cn.itsource.basic.utils;

import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class AjaxResult {
    private Boolean success = true;
    private String message = "操作成功";
    private Object obj;

    public AjaxResult(Boolean success, String message) {
        this.success = success;
        this.message = message;
    }


    //链式语法
    public static AjaxResult me(){
        return new AjaxResult();
    }

    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;

    }

    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }

    public AjaxResult setObj(Object obj) {
        this.obj = obj;
        return this;
    }
}
